.so ../bk-macros
.TH "bk crypto" "\*[BKVER]" %E% "\*(BC" "\*(UM"
.SH NAME
bk crypto \- Cryptography services
.SH SYNOPSIS
.B bk crypto \-i
.ARG bits
.ARG secret-key
.ARG public-key
.br
.B bk crypto \-s
.ARG secret-key
.B <
.ARG data
.B >
.ARG signature
.br
.B bk crypto \-v
.ARG public-key
.ARG signature
.B <
.ARG data
.br
.SH DESCRIPTION
.LP
The
.B bk crypto
command allow access to the cryptography subsystem of \*[BK] for
use in scripts to sign and validate data.  This code uses a straight
RSA signature scheme.
.SH OPTIONS
.TP
.B \-i
Create a new RSA key pair.  This option creates a new random RSA keypair
and saves the output in two filenames given on the command line. This 
command needs to generate a lot of random data from your system so it
can take a long time to complete.
.tp
.B \-s
Create a RSA signature for data read from stdin using a private key. 
Given a RSA private key created with the 
.Q bk crypto \-i
command, the
.Q \-s
option will read arbitrary data from stdin and then write a signature
to standard out that can be verified with the 
.Q bk crypto \-v
command.
.tp
.B \-v
Validate a RSA signature using a public key.  This command will read
arbitrary data from stdin and a RSA public key from the command line
and will validate that the signature matches the data and can only have
be created by the matching private key.
.SH "SEE ALSO"
.SA base64
.SH CATEGORY
.B Utility
